﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RCSDecoupling.CUiRCSUpDown
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;


namespace DnProcessSimulateCommands.RCSDecoupling;

internal class CUiRCSUpDown : NumericUpDown
{
  public void C1EditorInitialize(object value, IDictionary editorAttributes)
  {
    this.Value = (Decimal) Convert.ChangeType(value, typeof (Decimal));
    this.Select(0, int.MaxValue);
  }

  public void C1EditorUpdateBounds(Rectangle rc)
  {
    this.FontHeight = rc.Height;
    this.Bounds = rc;
  }

  protected override bool ProcessDialogKey(Keys keyData)
  {
    if (keyData != Keys.Return)
      return base.ProcessDialogKey(keyData);
    this.Parent.Focus();
    if (this.Parent.Focused)
      SendKeys.Send("{Down}");
    return true;
  }
}
